﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <script>
        let str = `黑色幽默`;
        //索引号
        for (var i = 0; i < str.length; i++) {
            console.log(str.charAt(i));
        }
        for (var i in str) {
            console.log(i,str[i]);
        }
        for (var i of str) {
            console.log(i);
        }
        
    </script>
</body>
</html>